<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的顾客</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body>
  <div id="blank" class="header" style="border-bottom:1px solid #D6D6D6;color:#000">
      <div v-back.tapmode class="back"></div>
      <span id="title">我的团队</span>
  </div>
    <div class="container" id="app" v-cloak style="padding-top:60px;">
        <div class="mycustomer-top" :class="BSImg">
          <span class="shop-word">团队（人）</span>
          <span class="shop-number">{{infos.team_info.sub_shop_count_all+infos.team_info.sub_member_count_all}}</span>
        </div>
        <div class="mycustomer-middle">
            <div>
                <p>{{infos.team_info.sub_shop_count_all}}</p>
                <p>总店主数</p>
            </div>
            <div>
                <p>{{infos.team_info.cur_month_sub_shop_count_all}}</p>
                <p>店主数（本月新增）</p>
            </div>
            <div>
                <p>{{infos.team_info.sub_shop_count_l1}}</p>
                <p>直推店主</p>
            </div>
            <div>
                <p>{{infos.team_info.cur_month_sub_shop_count_l1}}</p>
                <p>直推店主（本月新增）</p>
            </div>
        </div>
        <div class="mycustomer-gaps">
          直推店列表
        </div>
        <div class="mycustomer-bottom">
          <div class="mycustomer-container" v-for="(content, index) in infos.sub_shops">
            <div class="mycustomer-avatar" style="padding-left:2px;width:60px;height:60px;">
            <img :src="content.portrait || '../../image/portrait_moren.png'">
            </div>
            <div class="mycustomer-title" style="padding-left:20px">
              <span style="font-size:18px">{{content.nickname}}</span>
              <span><span>总店主数：</span><span style="color:#CC0202;">{{content.sub_shop_count_l1}}</span><span style="padding-left:10px">本月新增：</span><span style="color:#CC0202;">{{content.cur_month_sub_shop_count_l1?content.cur_month_sub_shop_count_l1:0}}</span></span>
            </div>
          </div>
        </div>
    </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>

    var infos;
    apiready = function () {
        setBSImg();
        showProgress();

        new Vue({
            el: '#blank'
        });

        var data = {
            member_id: getPrefs('member_id')
        }
        var callback = function (ret) {
            infos = ret.content;
            initApp();
            api.parseTapmode();
        };
        pinet.post(URL.getSubmemberinfo, data, callback);

        addListeners();
    };

    function initApp() {
        new Vue({
            el: '#app',
            data:{
                infos:infos,
                BSImg: {
                    big: Vue.BSImg == 'big',
                    small: Vue.BSImg == 'small'
                }
            }
        })
    }

    function addListeners() {
        api.addEventListener({
            name: 'withdraw'
        }, function () {
            window.location.reload();
        });

        api.addEventListener({
            name: 'viewappear'
        }, function () {
            onPageStart();
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function (ret, err) {
            onPageEnd();
        });

        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            onPageEnd();
            api.closeWin();
        });
    }

</script>
</html>
